neo-mcp-logic-analyze
Python MCP server for controlled logic analysis from natural language, with an emphasis on auditable output and teaching-oriented explanations.
What it does
This server accepts short natural-language statements and arguments, then provides structured logic-oriented outputs such as:
- controlled formalization into propositional logic;
- controlled formalization into a restricted fragment of first-order logic;
- ambiguity detection relevant to formalization;
- consistency checking;
- entailment checking;
- simple counterexamples when entailment fails;
- natural-language explanations of the formalization process.
MCP tools
The server exposes the following MCP tools:
nl_parse_logicdetect_ambiguitiescheck_consistencycheck_entailmentfind_counterexampleexplain_formalizationnormalize_argument
MCP resources
The server also exposes these resources:
logic://schemas/ast-v1logic://examples/propositionallogic://examples/follogic://guides/ambiguity-taxonomy
MCP prompts
Available prompts:
formalize_argumentteach_logic_step_by_stepreview_formalization
Requirements
- Python 3.11+
Installation
Clone the repository and install the package into your current Python environment:
git clone https://github.com/giseldo/neo-mcp-logic-analyze
cd neo-mcp-logic-analyze
python -m pip install .
For development dependencies:
python -m pip install -e .[dev]
Quick run
The server is designed to be launched by an MCP client over stdio, such as Claude Desktop, Cursor, or another MCP-compatible host.
To verify that the package is installed correctly, run:
neo-mcp-logic-analyze
Expected output:
neo-mcp-logic-analyze: servidor MCP iniciado em stdio; aguardando cliente...
The process will remain open waiting for an MCP client connection. Stop it with Ctrl+C.
MCP client configuration
After installing the project with pip install . or pip install -e ., configure your MCP client like this:
{
"mcpServers": {
"neo-mcp-logic-analyze": {
"command": "neo-mcp-logic-analyze"
}
}
}
Example requests
Use the following examples from your MCP client.
Normalize an argument
Tool: normalize_argument
text = "If it rains, the street gets wet. It rains. Therefore, the street gets wet."
Expected behavior:
- premises are separated from the conclusion;
- the conclusion is identified as
a rua molha.
Propositional entailment
Tool: check_entailment
premises = ["If it rains, the street gets wet.", "It rains."]
conclusion = "The street gets wet."
logic_family = "propositional"
Expected behavior:
- entailment succeeds;
- the response includes a proof sketch.
First-order logic formalization
Tool: nl_parse_logic
text = "Every student studies."
logic_family = "fol"
return_alternatives = true
Expected behavior:
- at least one candidate formalization is returned;
- one expected surface form is
forall x. (Aluno(x) -> Estuda(x)).
Ambiguity detection
Tool: detect_ambiguities
text = "Every student has read a book."
Expected behavior:
- the server reports at least one quantifier-scope ambiguity.
Consistency checking
Tool: check_consistency
premises = ["Every professor does research.", "No professor does research."]
logic_family = "fol"
Expected behavior:
- the set is inconsistent;
- the response can include an unsat core.
Counterexample search
Tool: find_counterexample
premises = ["If I study, I pass.", "I passed."]
conclusion = "I studied."
logic_family = "propositional"
Expected behavior:
- the conclusion is not entailed;
- the response can include a counterexample model.
Limitations
- Natural-language interpretation is heuristic and intentionally restricted.
- The project is optimized for short inputs, not long free-form texts.
- When the input is ambiguous, the server prefers warnings and alternative readings instead of forcing a single interpretation.
Uninstall
If you installed the package with pip install . or pip install -e ., remove it with:
pip uninstall neo-mcp-logic-analyze
Server Config
{
"mcpServers": {
"neo-mcp-logic-analyze": {
"command": "neo-mcp-logic-analyze"
}
}
}